Apparatus and method for character string recognition

ABSTRACT

An apparatus and a method for character string recognition for correctly recognizing a character string placed on a medium, even in a recognition process system in which a plurality of formats are handled. An image processing area is set on a medium. The image processing area is divided in a placement direction of character strings so as to make up a plurality of segments. An image data projection in a direction of character strings is calculated for each segment. The number of character string lines for each segment is calculated according to the image data projection. The number of character string lines is determined for the image processing area as a whole, according to the number of character string lines for each segment, and it is judged whether or not the character strings are predetermined character strings.

The present application claims priority from Japanese Patent ApplicationNo. JP 2010-095638 filed on Apr. 19, 2010, the disclosure of which isincorporated herein by reference in its entirety.

FIELD OF THE INVENTION

The present invention relates to an apparatus and a method for characterstring recognition for optically reading a character string placed on amedium (record carrier) made of paper and plastic materials.

A “character string” in the present invention means a series of multiplecharacters, wherein the “characters” include not only commonly-usedletters of the alphabet but also symbol characters, pictographcharacters, barcodes, 2D codes, as well as numeric characters, and theymay be in any form and any size as far as they can be recognizedvisually on a medium. Furthermore, it does not matter whether thecharacters are type characters or handwritten characters.

DESCRIPTION OF RELATED ART

Conventionally known are apparatuses and methods for character stringrecognition in order to recognize a character printed a surface of amedium such as a check. In the case of such an apparatus and a methodfor recognizing a character string, when a transfer speed of a mediumfluctuates due to manual operation so as to cause a distortion of animage for character string recognition in a medium transfer direction,accordingly sometimes the image is also distorted in a directionperpendicular to the medium transfer direction (For example, sometimesthe character string eventually becomes tilted and undulated). Moreover,if a bottom side of the medium is detached from a medium transfer pathof an imaging device (the apparatus for character recognition), theimage is also distorted sometimes in a direction perpendicular to themedium transfer direction.

To solve such a problem, for example, a method for character recognitiondisclosed in Japanese Unexamined Patent Application Publication No.2007-272348 (“JP 2007-272348”) includes; a first step of calculatingprojection data of an objective image in a direction of an objectivecharacter string placed on a medium (a placement direction of thecharacters, which is called a “horizontal direction”), while shifting anobjective projecting position at least for one pixel in a directionperpendicular to the direction of the character string (which is calleda “vertical direction”); and a second step of detecting a position ofthe character string in the vertical direction according to the firstprojection data obtained through the first step; wherein in the firststep described above, the image data is divided into a certain number ofsections (segments) in the direction of the character string, andsubsequently the projection data is calculated in the horizontaldirection for each segment.

More specifically, in the calculation of the projection data in thehorizontal direction (the first projection data) that is required fordetecting the position of the character string in the verticaldirection, a range for adding pixel values does not cover an entirewidth along a transfer direction of the medium or the direction of thecharacter string, but the range is equally segmented into a certainnumber of segments and the projection data of each segment is calculatedin the horizontal direction while having a length of the segment as therange for adding pixel values. Therefore, even if the character stringis tilted, it is still possible to suppress the effect that the firstprojection data becomes dull because of the tilt. As a result, even whenthe image is distorted in the direction perpendicular to the directionof the character string, a decrease in accuracy for character stringrecognition can be avoided.

Unfortunately in the method for character recognition disclosed in JP2007-272348; if the number of character string lines detected for eachsegment satisfies the condition on the number of lines of an assumedformat even when a medium having a format different from the assumedformat with respect to the character string is loaded, it is wronglyjudged that a medium having the assumed format is loaded. As a result,reading operation cannot be carried out correctly. In the aboveexplanation, the format is concerned with a position and an extent of anarea where characters are written, the number of character strings, thenumber of characters, the size of characters, and the like.

SUMMARY OF THE INVENTION

It is an object of the present invention to provide an apparatus and amethod for character string recognition that make it possible torecognize each format correctly even in a recognition process system inwhich a plurality of formats are handled.

To solve the problem identified above, an aspect of Claim 1 of thepresent invention is a character string recognition apparatus, forrecognizing a character string through processing image data obtained byimaging the character string placed on a medium, comprising: means forsetting a character string search area for setting the character stringsearch area on the medium; means for preparing segments for making up aplurality of segments by segmenting the character string search area ina direction of the character string; means for calculating projectionfor calculating the projection of the image data in direction of thecharacter string for each of the segments; means for calculating thenumber of character string lines for calculating the number of characterstring lines for each of the segments according to the projection of theimage data; means for determining the number of character string linesfor determining the number of character string lines in the characterstring search area as a whole according to the number of characterstring lines in each of the segments; and means for checking thecharacter string validity for verifying whether or not the characterstring is a predetermined character string, according to the number ofcharacter string lines in the character string search area as a whole.

In addition to the configuration described in Claim 1, an aspect ofClaim 2 of the present invention is the character string recognitionapparatus: wherein the means for determining the number of characterstring lines creates a frequency distribution on the number of segmentsshowing a predetermined number of character string lines according todata of the number of character string lines in each of the segments,and determines the number of character string lines in the characterstring search area as a whole, with the number of character string lineshaving a maximum frequency.

In addition to the configuration described in Claim 2, an aspect ofClaim 3 of the present invention is the character string recognitionapparatus: wherein the means for setting a character string search areasets another character string search area, being different from theformentioned character string search area, over the medium if thefrequency distribution on the number of segments showing thepredetermined number of character string lines is not normal.

In addition to the configuration described in Claim 2, an aspect ofClaim 4 of the present invention is the character string recognitionapparatus: wherein the means for preparing segments increases/decreasesthe number of segments for the character string search area to make upanother type of segments, being different from the formentioned segmentsif the frequency distribution on the number of segments showing thepredetermined number of character string lines is not normal.

In addition to the configuration described in any one of Claims 1 to 4,an aspect of Claim 5 of the present invention is the character stringrecognition apparatus: wherein the means for checking the characterstring validity calculates character string positions in a directionperpendicular to the direction of the character string for each of thesegments, and checks the presence of unusual data in the characterstrings according to first-order differences of positions of thecharacter string, and then judges that the character strings arepredetermined character strings if no unusual data is detected in thecharacter strings.

In addition to the configuration described in Claim 5, an aspect ofClaim 6 of the present invention is the character string recognitionapparatus: wherein the means for setting a character string search areasets another character string search area, being different from theformentioned character string search area, over the medium if unusualdata is detected in the character strings.

In addition to the configuration described in Claim 5, an aspect ofClaim 7 of the present invention is the character string recognitionapparatus: wherein, at the time of checking the presence of unusual datain the character strings, the means for checking the character stringvalidity judges that unusual data exists in the character strings if amaximum absolute value of second-order differences of character stringpositions with respect to each of the segments exceeds a predeterminedthreshold.

In addition to the configuration described in Claim 5, an aspect ofClaim 8 of the present invention is the character string recognitionapparatus: wherein the character string positions are character stringcenter positions.

In addition to the configuration described in any one of Claims 1 to 4,an aspect of Claim 9 of the present invention is the character stringrecognition apparatus: wherein the number of segments to be made up isn-th power of 2 (where the “n” is a positive integer).

An aspect of Claim 10 of the present invention is a character stringrecognition method, for recognizing a character string throughprocessing image data obtained by imaging the character string placed ona medium, comprising: a character string search area setting step forsetting the character string search area on the medium; a segmentpreparing step for making up a plurality of segments by segmenting thecharacter string search area in a direction of the character string; aprojection calculating step for calculating the projection of the imagedata in direction of the character string for each of the segments; astep for calculating the number of character string lines forcalculating the number of character string lines for each of thesegments according to the projection of the image data; a step fordetermining the number of character string lines for determining thenumber of character string lines in the character string search area asa whole according to the number of character string lines in each of thesegments; and a step for checking the character string validity forverifying whether or not the character string is a predeterminedcharacter string, according to the number of character string lines inthe character string search area as a whole.

The apparatus and method for character string recognition according tothe present invention enables recognizing each format correctly even ina recognition process system in which a plurality of formats areexpected.

Furthermore, according to the present invention, an area for characterstring search on a medium is divided into a plurality of segments in adirection of the character string, and the number of character stringlines of the entire area for character string search is determinedaccording to the number of character string lines in each of thesesegments. Then, according to the number of character string lines, avalidity of the character string (whether or not the character string isa predetermined character string) can be verified.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram showing an electrical structure of a characterstring recognition apparatus in accordance with a first embodiment ofthe present invention.

FIG. 2 is a block diagram showing a character segmenting section of thecharacter string recognition apparatus shown in FIG. 1.

FIG. 3 is a flowchart describing a general operation flow of a characterstring recognition method in accordance with the first embodiment.

FIG. 4 is a flowchart describing a detailed operation flow of characterstring segmentation in the flowchart shown in FIG. 3.

FIG. 5 is a front view of an ID card.

FIG. 6 shows a first example of image data captured by imaging acharacter string placed on a medium.

FIG. 7 shows a horizontal projection curve as a result of projecting theimage data shown in FIG. 6 in a direction of a character string.

FIG. 8 is a list showing the number of character string lines in eachsegment of the image data shown in FIG. 6.

FIG. 9 is a frequency distribution list on the number of segmentsshowing a predetermined number of character string lines in accordancewith the number of character string lines shown in FIG. 8.

FIG. 10 is a list showing another example of the number of characterstring lines in each segment.

FIG. 11 is a frequency distribution list on the number of segmentsshowing the predetermined number of character string lines in accordancewith the number of character string lines shown in FIG. 10.

FIG. 12 shows a second example of image data captured through imaging acharacter string placed on a medium.

FIG. 13 shows a horizontal projection curve as a result of projectingthe image data shown in FIG. 12 in a direction of a character string.

FIG. 14 is a list showing the number of character string lines in eachsegment of the image data shown in FIG. 12.

FIG. 15 is a frequency distribution list on the number of segmentsshowing the predetermined number of character string lines in accordancewith the number of character string lines shown in FIG. 14.

FIG. 16 is a list showing a first-order difference of character stringcenter positions in the image data shown in FIG. 12.

FIG. 17 is a list showing a second-order difference of character stringcenter positions in the image data shown in FIG. 12.

FIG. 18 is a flowchart describing a detailed operation flow of charactersegmentation in the flowchart shown in FIG. 3.

FIG. 19 is a flowchart describing a detailed operation flow of characterstring segmentation in a flowchart showing a general operation flow of acharacter string recognition method in accordance with a secondembodiment of the present invention.

DETAILED DESCRIPTION OF EMBODIMENTS

It is to be understood that the figures and descriptions of the presentinvention have been simplified to illustrate elements that are relevantfor a clear understanding of the present invention, while eliminating,for purposes of clarity, many other elements which are conventional inthis art. Those of ordinary skill in the art will recognize that otherelements are desirable for implementing the present invention. However,because such elements are well known in the art, and because they do notfacilitate a better understanding of the present invention, a discussionof such elements is not provided herein.

The present invention will now be described in detail on the basis ofexemplary embodiments.

First Embodiment of the Present Invention

FIGS. 1 to 18 represent a first embodiment of the present invention.

Configuration of Character String Recognition Apparatus:

As shown in FIG. 1, a character string recognition apparatus 1 inaccordance with the first embodiment is an apparatus for recognizing acharacter string printed in a character recording area 60 throughprocessing image data obtained by imaging the character recording area60 placed on an ID card (an identification card) 6 (hereinafter, called“ID card 6”) as a medium. The character string recognition apparatus 1includes a data input section 2, an image memory 3, and a data processor5.

The data input section 2 captures an image of the character recordingarea 60 positioned on the ID card 6, and converts the image intomulti-valued image data, and then saves the data into the image memory3. In the first embodiment, the character string recognition apparatus 1includes a medium transfer mechanism 2 a for transferring the ID card 6,and an one-dimensional contact imaging element 2 b for imaging andreading the character recording area 60 positioned on the ID card 6, asshown in FIG. 1.

The medium transfer mechanism 2 a transfers the ID card 6 in apredetermined transfer direction “T” (from the left to the right inFIG. 1) by using a transfer means that is not shown. In the firstembodiment, a transfer guide 2 c is formed in the medium transfermechanism 2 a so as to transfer the ID card 6 while keeping one side ofthe ID card 6 (a bottom side of the card in FIG. 1) contacting thetransfer guide 2 c.

The imaging element 2 b is a line sensor composed of CCDs and the like,and constituent components of the imaging element 2 b are placed in linein a direction almost perpendicular to the transfer direction “T” (awidth-wise direction of the ID card 6). As shown in FIG. 1, the imagingelement 2 b is so formed as to be longer than a width of the characterrecording area 60 in its width-wise direction, the character recordingarea 60 being formed on the ID card 6. Incidentally, in the firstembodiment, while the analog image data being output from the imagingelement 2 b, an analog-digital converter circuit not shown is connectedin the character string recognition apparatus 1, and then theanalog-digital converter circuit converts the analog image data intodigital image data. More specifically, the analog image data isconverted, for example, into 8-bit 256-level multi-valued image data,and output to the image memory 3. Since such an analog-digital convertercircuit is publicly known, detailed explanation is omitted here.

The image memory 3 is provided with a function for dealing with themulti-valued image data obtained through the image capturing as a matrixincluding a limited number of pixels, and saving the data arbitrarilywhile reading out a pixel value of each pixel as a brightness value. Thebrightness value is expressed with a numeric value within a certainrange. Specifically to describe, brightness values of 8-bit 256-levelmulti-valued image data are expressed with integers within a range from0 to 255. Furthermore, in the first embodiment, M×N pixels are placedand configured as a matrix for saving the multi-valued image data of anentire section of the character recording area 60 into the M×N blocks.The image memory 3 may be structured with any of a RAM, an SDRAM, aDDRSDRAM, an RDRAM, and the like, as far as it can arbitrarily read outand save the multi-valued image data.

Moreover, the image memory 3 has a function for saving black-and-whitebinary image data created by an image binarizing section 5 a to bedescribed later.

As shown in FIG. 1, the data processor 5 includes; a main controller 50for controlling an entire section of the data processor 5, the imagebinarizing section 5 a, a character string segmenting section 5 b, acharacter string search area storage section 5 c, a character segmentingsection 5 d, a characteristics extracting section 5 e, a characteristicscomparing section 5 f, a characteristics dictionary storage section 5 g,and a character judging section 5 h.

The image binarizing section 5 a converts the multi-valued image datasaved in the image memory 3 into binary image data. For the binarizingoperation, a binarizing threshold is calculated through a publicly-knownappropriate method such as a discrimination analysis method. Then, apixel having a brightness value, which is relatively high in themulti-valued image data, is identified as a white element; and on theother hand, a pixel having a relatively low brightness value isidentified as a black element. Through such an operation, themulti-valued image data is converted into black-and-white binary imagedata. Then, eventually the binary image data of the entire section ofthe character recording area 60 is created in the M×N blocks that isconfigured with the M×N pixels placed as a matrix.

The character string segmenting section 5 b segments a character stringout of the binary image data obtained in the image binarizing section 5a. As shown in FIG. 2, in the present embodiment, the character stringsegmenting section 5 b includes; a character string search area settingsection 51, an image processing area setting section 52, a segmentpreparing section 53, a projection calculating section 54, a section forcalculating the number of character string lines 55, a section fordetermining the number of character string lines 56, a section forjudging the number of character string lines 57, a differencecalculating section 58, and a character string validity check section59. In the meantime, the character string segmenting section 5 b isunder control of the main controller 50.

The character string search area storage section 5 c stores informationon positions, shapes, and the like of character string search areascorresponding to various kinds of media (including a check, a creditcard, and so on in addition to the ID card 6) that the character stringrecognition apparatus 1 can handle. For example, a rectangular characterstring search area A1 is placed in a lower section in the ID card 6, asshown in FIG. 5. Meanwhile, personal information including a face photo,a name, an address, and the like is printed in a higher area. As shownin FIG. 6, the character string search area A1 in the first embodimentis set as an area smaller than the character recording area 60 that FIG.1 shows.

The character segmenting section 5 d estimates a single-character areathrough calculating, for example, characteristics of a circumscribingrectangle, a placement direction of a character string of black pixels,histogram characteristics in a direction perpendicular to the placementdirection, and the like according to a binary image data of a characterstring segmented in the character string segmenting section 5 b forsegmenting each character as binary image data.

The characteristics extracting section 5 e extracts a characteristicsvector of the binary image data of each character segmented in thecharacter segmenting section 5 d. Extracted as characteristics of eachcharacter are edge orientation characteristics of the character, strokedensity characteristics of the character, structure-analysischaracteristics, and so on. In the first embodiment, any characteristicsextraction method can be applied arbitrarily.

The characteristics comparing section 5 f associates the characteristicsvector of the binary image data of the character to be recognized with astandard characteristics vector registered in the characteristicsdictionary storage section 5 g, and makes a judgment on a validationlevel through, for example, checking whether a distance value, a degreeof similarity, and a characteristics element included in the standardcharacteristics vector exit in the characteristics vector of the binaryimage data of the character to be recognized in order to output arecognition candidate character.

The characteristics dictionary storage section 5 g stores standardcharacteristics vectors of all characters to be used in the ID card 6.

The character judging section 5 h outputs the recognition candidatecharacter output from the characteristics comparing section 5 f as thecharacter used in the ID card 6.

Procedure of Character String Recognition Method:

With reference to the flowchart shown in FIG. 3, a series of operationprocedures in a character string recognition method is described next.

In order to recognize the character string placed on the ID card 6 byusing the character string recognition apparatus 1 provided with theconfiguration described above, the ID card 6 is transferred along thetransfer guide of the medium transfer mechanism 2 a in the data inputsection 2. In the meantime, as the ID card 6 passes by theone-dimensional imaging element 2 b of the data input section 2,captured is an image of a surface of the ID card 6 including thecharacter recording area 60 where the character string is printed. Anoptical image is captured by the one-dimensional imaging element 2 b,and an analog image signal obtained through the image capturing isphoto-electrically converted; namely, converted into digital multi-leveldata such as 8-bit 256-level multi-valued image data, and then theconverted image data is saved in the image memory 3. The image memory 3outputs the multi-valued image data to the data processor 5. Asdescribed below in detail, the data processor 5 executes a series ofcharacter string recognition procedures (including; an image binarizingstep, a character string segmenting step, a character segmenting step, acharacteristics extracting step, a characteristics comparing step, and acharacter recognition step) in due order.

Image Binarizing Step:

At first in Step S1, the image binarizing section 5 a carries out theimage binarizing step. More specifically, the image binarizing section 5a reads out the multi-valued image data from the image memory 3, andconverts the multi-valued image data into binary image data. Then, thebinary image data converted is stored in the image memory 3, while beingstored as binary image data into a memory area being different from amemory area in which the multi-valued image data is stored. Theblack-and-white binary image data is used hereafter in the followingsteps.

Character String Segmenting Step:

After the image binarization, operation progresses to Step S2, and thecharacter string segmenting section 5 b carries out the character stringsegmenting step. The character string segmenting step is described inthe following explanation, with reference to the flowchart shown in FIG.4.

At first, in Step S11 (a character string search area setting step), thecharacter string search area setting section 51 of the character stringsegmenting section 5 b reads out information on a position, a shape, andthe like of the character string search area A1 corresponding to the IDcard 6, from the character string search area storage section 5 c.Concretely to describe, the rectangular character string search area A1is set at a confined section in which two character strings are formed,as FIG. 6 shows.

Furthermore, in Step S12 (an image processing area setting step), theimage processing area setting section 52 of the character stringsegmenting section 5 b detects a left edge EL and a right edge ER of thetwo character strings, as FIG. 6 shows, to narrow a section of thecharacter string search area A1 in the direction of the characterstrings for setting an image processing area (effective area) B1. Inother words, the image processing area (effective area) B1 is arectangle that circumscribes the left edge EL and the right edge ER ofthe segmented character strings. Namely, the image processing area(effective area) B1 is an area effective for the processing operationwhere the following steps from the character string segmenting step downto the character recognizing step become effective.

Concretely to describe, in vertical projection data obtained throughscanning operation in a direction toward the right, starting from a lefttop point PO, as a start point, in the binary character string searcharea A1; if a count value (the number of detected black pixels) at eachpixel row successively exceeds a predetermined threshold for a certainnumber of times (e.g., 3 times), a position shifted back for severalpixels toward the left from a first one of the pixel rows exceeding thethreshold is defined as the left edge EL of the image processing areaB1. Meanwhile, in vertical projection data obtained through scanningoperation in a direction toward the left, starting from a right toppoint PE, as a start point, in the character string search area A1; if acount value at each pixel row successively exceeds the predeterminedthreshold for the certain number of times, a position shifted back forseveral pixels toward the right from a first one of the pixel rowsexceeding the threshold is defined as the right edge ER of the imageprocessing area B1. Thus, the image processing area B1 is set within thecharacter string search area A1.

As FIG. 6 shows, a dimension in the vertical direction (i.e., a width)of the image processing area (effective area) B1 is the same as that ofthe character string search area A1.

In the above explanation, the “scanning operation” means calculating theimage data projection, while shifting an objective projecting positionin the binary image data (a matrix including pixel elements) for atleast one pixel in a line (horizontal) direction or a row (vertical)direction; wherein a direction of the image data projection beingperpendicular to the shifting direction of the objective projectingposition. Namely, calculating the image data projection is to sum up aprojected density (i.e., density distribution/histogram) in which thenumber of pixels converted into “1” or “0” through binarization issummed up for each digit group. In the calculation, either of whitepixels and black pixels may be summed up; and in the present embodiment,black pixels are summed up.

Next, in Step S13 (a segment preparing step), the segment preparingsection 53 makes up 8 segments SE (from SE1 to SE8) by segmenting theimage processing area B1 in a placement direction of character stringsplaced on the ID card 6 (a horizontal direction), as shown in FIG. 6.The number of segments SE to be made up is set to be 8 in this case, butany other number may be applied. When the number of segments SE to bemade up is n-th power of 2 (wherein the “n” is a positive integer forexample, 2, 4, 8, 16 and so on), a post-processing advantageouslybecomes easy.

In Step S14 (a projection calculating step) next, the projectioncalculating section 54 calculates a horizontal binary image dataprojection in a direction of character strings placed on ID card 6 (ahorizontal direction), for each of the segments SE1 to SE8. Morespecifically, while shifting an objective projecting position in adirection perpendicular to the direction of the character strings (avertical direction), the number of pixels having binary image data “1”corresponding to black pixels in each pixel line is summed up in orderto create a horizontal projection histogram. Then, corresponding to thearrangement of 8 segments SE shown in FIG. 6, a horizontal projectioncurve shown in FIG. 7 is obtained.

For each segment SE shown in FIG. 7, a horizontal axis represents thenumber of pixels having binary image data “1” corresponding to blackpixels, wherein a right end of each segment is a baseline for the numberof black pixels being 0. When the number of black pixels increases, abrightness value decreases to make the graph line curved from the rightto the left. In the meantime, a vertical axis represents a positionwithin an area (distance) from the top end to the bottom end of theimage processing area B1.

Next, in Step S15 (a step for calculating the number of character stringlines), the section for calculating the number of character string lines55 calculates a center position(s) and the number of lines of characterstrings for each segment SE by making use of the horizontal projectioncurve created for each segment SE in the projection calculating section54. For example, a list shown in FIG. 8 indicates a calculation resultaccording to the horizontal projection curve (the horizontal projectionhistogram of the binary image data) shown in FIG. 7; namely, the listshows center positions and the number of lines with respect to 2character strings for each of segments SE1 to SE8.

Specifically, in the calculation step for the segment SE8 shown in FIG.7; starting from a start point “S” (the start point “S” is predeterminedwith a number appropriate for the ID card 6), a search operation iscarried out along the projection data in a direction toward the bottomto find a point LT1, at which a brightness value begins decreasing (tobecome lower than a predetermined threshold), and another point LB1, atwhich a brightness value increases to recover (to become higher than thepredetermined threshold). Then, a middle point LC1 between the twopoints, namely a point given by calculation of (LT1+LB1)/2, is saved asan upper character string center position shown in FIG. 6. In the samemanner, for a character string coming up next at a lower place, thesearch operation continues until it reaches an end of the projectiondata to find a point LT2 and another point LB2. Then, another middlepoint LC2 between the two points, namely a point given by calculation of(LT2+LB2)/2, is saved as a lower character string center position shownin FIG. 6. In the same manner, for each of the segments SE1 to SE7, thenumber of character string center positions is counted to define thenumber as the number of character string lines. In the first embodiment,2 character strings are formed in the ID card 6, as shown in FIG. 5,FIG. 6, and FIG. 7. Therefore, in an example shown in FIG. 8, the numberof character string lines is 2 in every segment SE. Incidentally, thecharacter string center positions indicating the middle point LC1 havevalues in a range of 250 to 253 in FIG. 8, which are deemed to be withinan allowable range, so as to conclude that these center positions arefor the same character string at the upper side. In the same way, thecharacter string center positions indicating the middle point LC2 havevalues in a range of 395 to 400, deemed to be within an allowable range,so as to conclude that these center positions are for the same characterstring at the lower side.

In the case of any medium other than an ID card 6, being not shown,sometimes there is formed one character string in a character stringsearch area. FIG. 10 shows such a case in which the number of characterstring lines is calculated for one character string. In an example ofFIG. 10, the character string center positions for all the segments SE1to SE8 are almost 416, and therefore the number of character stringlines is 1 in this case.

Thus, in the first embodiment, the character string center positions aredealt with as positions of character strings, and therefore apost-processing is advantageously simplified.

Next, in Step S16 (a step for determining the number of character stringlines), the section for determining the number of character string lines56 creates a frequency distribution on the number of segments showing apredetermined number of character string lines, according to data of thenumber of character string lines in the segments SE1 to SE8 obtainedthrough Step S15, as shown in FIG. 9. Then, with reference to thefrequency distribution, the number of character string lines isdetermined.

For example, in the example of FIG. 8, the number of character stringlines in all the segments SE1 to SE8 is 2. Thus, as shown in FIG. 9, afrequency for the number of character string lines being 2 is 8, andother frequencies are all zero. As a result, it is determined that thenumber of character string lines is 2. Consequently, for the imageprocessing area B1 as a whole, the number of character string lines isdetermined to be 2.

In the same way, in the example of FIG. 10, the number of characterstring lines in all the segments SE is 1. Thus, as shown in FIG. 11, afrequency for the number of character string lines being 1 is 8, andother frequencies are all zero. As a result, it is determined that thenumber of character string lines is 1. Consequently, for the imageprocessing area B1 as a whole, the number of character string lines isdetermined to be 1.

Owing to, for example, an effect of an arrangement of the segments SE,sometimes the number of character string lines for each segment SE doesnot necessarily become the same. The segments SE at both ends (i.e., SE1and SE8) in particular include some blank spaces at the right and leftsides of the character strings so that an error in the number ofcharacter strings may be caused. In such a case, a maximum frequencybecomes less than the number of prepared segments SE (i.e., 8). However,a frequency being 7 is dealt with as an allowable number For example, inthe case shown in FIG. 8, if a frequency for the number of characterstring lines being 2 is 7, it is judged that the frequency distributionon the number of segments showing the predetermined number of characterstring lines is normal. Namely, even though either of the segments SE atboth the ends has an effect of the end segment so as to result in thenumber of character string lines being less than the actual number, thenumber of character string lines is assumed to be still effective. Inthis case, 7 segments SE other than either of the segments SE at boththe ends have the same number of character string lines, and thereforeit is judged that the reliability of the number is high enough.

Next, in Step S17 (a step for judging the number of character stringlines) for excluding any case where the medium is not an ID card 6having the predetermined format, the section for judging the number ofcharacter string lines 57 judges whether or not the frequencydistribution on the number of segments showing the predetermined numberof character string lines is normal, according to the number ofcharacter string lines for each segment SE prepared in Step S13. As aresult, if it is judged according to the number of character stringlines for each prepared segment SE that the frequency distribution onthe number of segments showing the predetermined number of characterstring lines is not normal, it is determined that the medium is not anID card 6, and operation progresses to Step S20. On the other hand, ifit is judged that the frequency distribution on the number of segmentsshowing the predetermined number of character string lines is normal, itis supposed that the medium has a possibility of being an ID card 6, andoperation progresses to Step S18 to determine that the medium is an IDcard 6.

If a Medium Having a Format Different from that of an ID Card 6 isLoaded:

In the above step, even if it is judged according to the number ofcharacter string lines for each segment SE that the frequencydistribution on the number of segments showing the predetermined numberof character string lines is normal, it cannot be declared that themedium is an ID card 6. A reason why it cannot be declared is that thefrequency distribution being normal is not a sufficient condition thatthe medium is an ID card 6. In other words, as exemplified below, thereis assumed a case where the medium is not an ID card 6 even though thefrequency distribution on the number of segments showing thepredetermined number of character string lines is normal.

Concretely to describe, taken for example is a case where a mediumhaving a character string format different from that of an ID card 6 isloaded. For example, loaded is a medium different from an ID card 6,such as shown in FIG. 12 (e.g., a credit card, a company ID card, andthe like). In an image processing area B2 of the medium shown in FIG.12, one character string is formed almost at a center of the imageprocessing area B2, and a part of a face photo is also printed at aright upper end in the area. When such a medium described above isloaded into a processing system, a processed result of the characterstring segmentation is as FIGS. 13 to 15 show. FIG. 13 shows ahorizontal projection curve corresponding to an arrangement of 8segments SE 11 to SE18 shown in FIG. 12. In FIG. 13, a horizontal axisrepresents the number of pixels, and in the meantime, a vertical axisrepresents a position in a range (distance) from the top end to thebottom end of the image processing area B2. A list shown in FIG. 14indicates a calculation result according to the horizontal projectioncurve; namely, showing center positions and the number of lines withrespect to 1 character string for each of the segments SE11 to SE18.FIG. 15 indicates a frequency distribution on the number of segmentsshowing a predetermined number of character string lines, according todata of the number of character string lines in each of the segmentsSE11 to SE18.

In FIG. 15, a frequency for the number of character string lines being 2is 7 so as to satisfy the condition for determination of the number ofcharacter string lines that requires a frequency of 7 or greater. Thus,apparently the number of character string lines is 2, and therefore themedium is judged to be an ID card 6. This is because, owing to alocation state of some image data other than a character string inrelation with the segments SE, the image data satisfies the condition ofbeing an actual character string. As a result, according to the numberof character string lines for each of the segments SE, it is wronglyjudged that the frequency distribution on the number of segments showingthe predetermined number of character string lines is normal.Consequently, it cannot be judged that the medium is not an ID card 6.

In order to avoid such a mis-judgment described above; based on anassumption that, in the case of a medium being an ID card 6, a characterstring center position does not significantly shift between twoneighboring segments SE, the presence of any unusual data within thecharacter strings is checked in Step S18 and Step S19 even if it issupposed that the medium has a possibility of being an ID card 6. Morespecifically, a second-order difference of character string centerpositions is calculated between segments SE, and then any presence ofunusual data within the character strings is checked by making use ofthe second-order difference (Step S18). Thus, it is determined whetheror not the character strings are predetermined character strings on anID card 6, namely whether the medium is an ID card 6 for sure (Step S19)or not. These steps are described below.

In Step S18 (a step for checking any character string unusual data), thedifference calculating section 58 calculates a first-order differenceand a second-order difference of the character string center positionsshown in FIG. 16 and FIG. 17, with respect to each character string, asan indicator for indicating unusual data in the character string. FIG.16 is a list showing a first-order difference of character string centerpositions in the image data shown in FIG. 12, and in the meantime, FIG.17 is a list showing a second-order difference further according to thefirst-order difference.

Concretely to describe, at first the difference calculating section 58calculates a first-order difference of character string center positionsbetween two segments neighboring each other. For example, in upper dataLC11 assumed to be a character string in FIG. 14 showing the number ofcharacter string lines and character string center positions for eachsegment in the image data shown in FIG. 12; LC11 of a segment SE13 isequal to 149, and LC11 of a segment SE12 located at SE13's immediateleft is equal to 147. Therefore, a difference between both the LC11s is2. In the same manner, other first-order differences of character stringcenter positions with respect to other segments are also calculated tocreate a list of FIG. 16. Next, by making use of the calculation resultof the first-order differences, second-order differences of characterstring center positions are calculated with respect to each of thesegments SE as shown in FIG. 17 to create a list of FIG. 17. Forexample, in FIG. 17, a second-order difference “−91” at a third columnfrom the left in the upper row is a remainder as a result of subtractinga first-order difference “72” between SE14 and SE 15 from a first-orderdifference “−19” between SE15 and SE 16, with respect to the characterstrings in the upper raw shown in FIG. 16, wherein the first-orderdifference between SE14 and SE 15 being placed at the left side of thefirst-order difference between SE15 and SE 16.

Next, in Step S19 (a step for checking the character string validity),it is checked whether or not the medium is an ID card 6. Concretely todescribe, the character string validity check section 59 verifies foreach character string whether a maximum absolute value of thesecond-order differences of character string center positions withrespect to each of the segments SE exceeds a predetermined threshold(for example, “20”). Then, if the maximum absolute value of thesecond-order differences exceeds the predetermined threshold, it isjudged that there exists unusual data in the character strings, and thecharacter strings on the medium are not the predetermined characterstrings (namely, the medium is not an ID card 6). On the other hand, ifnot, it is judged that there does not exist any unusual data in thecharacter strings, and the character strings on the medium are thepredetermined character strings (namely, the medium is an ID card 6).

For example, in the case shown in FIG. 17, the second-order differencesof character string center positions of the upper character stringreads; −2, 72, −91, 19, and 1 in due order from the left so that amaximum absolute value of the second-order differences of characterstring center positions with respect to each of the segments SE is “91”.Since this value is unusually large in comparison with the thresholdvalue “20” defined above, it is judged that the upper character stringincludes unusual data. In the meantime, the second-order differences ofcharacter string center positions of the lower character string are; 0,0, 0, 1, and −2 in due order from the left so that a maximum absolutevalue is “2” in this case. Thus, this value is less than the thresholdvalue “20”, it is judged that the lower character string has normaldata. According to these results, since the upper character stringincludes unusual data, it is concluded that the medium is not an ID card6.

Thus, even when the medium being actually not an ID card 6 brings aboutby chance a state equivalent to what true character strings of an IDcard 6 create, it can still be judged through Step S18 (the step forchecking any character string unusual data) and Step S19 (the step forchecking the character string validity) that the medium is not an IDcard 6.

Moreover, as described above, the image processing area B2 set in amedium other than an ID card 6 is divided into a plurality of segmentsSE, and then any presence of unusual data within the character stringsis checked by making use of the second-order differences of characterstring center positions with respect to each of the segments SE.Therefore, even in the case where character strings placed on the mediumare tilted, a chance of reading the character strings correctly isimproved.

Then, if it is judged as a result of the process through Step S19 thatthe medium is an ID card 6, it is concluded that the character stringsdo not include any unusual data, and operation of the flowchart shown inFIG. 4 finishes.

On the other hand, if it is judged that the medium is not an ID card 6,operation progresses to Step S20 (a character string search areare-setting step) in the same manner as a case where the medium is judgednot to be an ID card 6 in the forgoing Step S17.

In Step S20, the character string search area setting section 51 of thecharacter string segmenting section 5 b reads out information on anothercharacter string search area, which is different from the characterstring search area A1 to be used for the ID card 6, from the characterstring search area storage section 5 c to set the newly read characterstring search area over the binary image data saved in the image memory3.

Next, in Step S21 (a step for checking any residual character stringsearch area), the main controller 50 of the data processor 5 judgeswhether or not any unused character string search area still remains. Ifno unused character string search area remains, operation of theflowchart shown in FIG. 4 finishes. Meanwhile, if any unused characterstring search area remains, operation returns to Step S12 to repeat thesteps described above. Incidentally, with regard to an order ofoperation of Steps S20 and S21, Step 21 may be carried out earlier, andit is also possible to carry out both the steps simultaneously.

By way of carrying out the steps described above, the character stringsegmenting step is executed in due order with respect to all thecharacter string search areas stored in the character string search areastorage section 5 c. Thus, every one of various card formats assumed canbe recognized correctly.

After the flowchart shown in FIG. 4 finishes, operation progresses toStep S3 of the flowchart shown in FIG. 3.

Character Segmenting Step:

The character segmenting step S3 is explained below according to aflowchart shown in FIG. 18. At first in Step S31, while shifting anobjective projecting position in a direction of character strings, thecharacter segmenting section 5 d calculates a vertical projection in adirection perpendicular to the direction of character strings.Concretely to describe, for one of the character strings (e.g., theupper character string within the image processing area B1 shown in FIG.6), the number of pixels of binary image data “1” corresponding to blackpixels is counted (summed up) in each pixel line perpendicular to thedirection of the character string (namely, in a vertical direction) tocreate a vertical projection histogram.

Next, the character segmenting section 5 d moves to Step S32 in order tocalculate the length of a character line according to the number ofpixels between both ends of the character string detected by making useof the vertical projection data obtained through Step S31.

Then, the character segmenting section 5 d moves to Step S33 in order todetect positions, where the vertical projection data obtained throughStep S31 exceeds a predetermined threshold, as segmenting positions ofcharacters constituting the character string. Concretely to describe;since the projection data includes the characters constituting thecharacter string as well as space parts among the characters, charactersegmenting positions are detected if the threshold is set with abrightness value of the space parts (the binary image data “0”corresponding to white pixels in the case of the first embodiment).

Through the character segmenting step described above, calculated arecircumscribing rectangular areas (i.e., coordinate values of an upperend, a lower end, a left end, and a right end for each of the charactersobjective for character recognition). Then, the flowchart shown in FIG.18 finishes, and operation progresses to Step S4 of the flowchart shownin FIG. 3.

Characteristics Extracting Step:

After the character segmentation, operation progresses to Step S4 forthe characteristics extracting section 5 e to extract characteristics.Namely, the characteristics extracting section 5 e divides acircumscribing rectangular area into “n×n” sub areas. For example, inthe case of “n=5”, 25 sub areas are created. Then, for each sub area, aproportion value of black pixels to all pixels in the sub area iscalculated, and a characteristics vector composed of these proportionvalues as elements is created.

Characteristics Comparing Step

After the characteristics extraction, operation progresses to Step S5for the characteristics comparing section 5 f to comparecharacteristics.

Namely, the characteristics comparing section 5 f compares thecharacteristics vector created in Step 4 with the standardcharacteristics vectors stored in the characteristics dictionary storagesection 5 g, and sets a standard characteristics vector showing ahighest degree of similarity (e.g., normalized correlation coefficient)as a candidate character for the objective character.

Character Recognizing Step:

After the characteristics comparison, operation progresses to Step S6for the character judging section 5 h to recognize a character.

Namely, the character judging section 5 h recognizes the candidatecharacter set in Step S5 as the character used in the medium 6.

If there exist multiple candidate characters having a degree ofsimilarity greater than a certain level, character recognition cannot becarried out at this stage. If so, operation deals with the character asan unidentified character, or carries out recognition for a similarcharacter by making use of secondary characteristics drawn out of thecharacteristics vector.

For example, an attention is focused on 3 kinds of symmetric properties(e.g., a horizontal line-symmetric property, a vertical line-symmetricproperty, and a point-symmetric property). For the horizontalline-symmetric property, the “n×n” sub areas are divided into twosections (i.e., a left half section and a right half section), and thena partial characteristics vector is configured to check theirsimilarity. Furthermore, for the vertical line-symmetric property, the“n×n” sub areas are divided into two sections (i.e., a upper halfsection and a lower half section), and then a partial characteristicsvector is configured to check their similarity. Still further, for thepoint-symmetric property, its similarity is also checked in the sameway. Since the 3 kinds of form characteristics amounts are obtained, acorresponding character is related according to relationships of theirvalues.

Sometimes there still remain some cases where a judgment cannot be made.For example, in the case of some types of characters to be used for themedium, it may be difficult to discriminate between “o” (an alphabetical“o”) and “0” (a numeric “0”). In such a case, checking differences inthe height of the character and the curvature at 4 round corners enablesjudgment.

After the step described above, the character string recognition methodby using the character string recognition apparatus 1 finishes itsoperation.

Advantageous Effects of the First Embodiment

As described above, according to the first embodiment, each format canbe recognized correctly even in a recognition process system in which aplurality of formats of media, such as the ID card 6 and the like, areexpected.

Furthermore, the image processing area B1 on a medium, such as the IDcard 6 and the like, is divided into a plurality of segments SE in aplacement direction of the character strings, and the number ofcharacter string lines of the entire area for the image processing areaB1 is determined according to the number of character string lines ineach of these segments SE. Then, according to the number of characterstring lines, a validity of the character strings (whether or not thecharacter strings are predetermined character strings) can be verified.

Second Embodiment of the Present Invention

FIG. 19 represents a second embodiment of the present invention.

Explained in the first embodiment described above is a case where, if itis judged according to the number of character string lines for eachprepared segment SE that the frequency distribution on the number ofsegments showing the predetermined number of character string lines isnot normal (i.e., the media 6 is not an ID card 6) as a result of thejudgment at Step S17 in the flowchart shown in FIG. 4, a differentcharacter string search area is set on the medium 6. Alternatively,instead of setting the different character string search area A2, adifferent type of segments SE may be created for the image processingarea B1 in the character string search area A1 initially placed.Explained below is a case where such a different type of segments SE iscreated.

More specifically, in the second embodiment as shown in FIG. 19, if itis judged according to the number of character string lines for eachprepared segment SE that the frequency distribution on the number ofsegments showing the predetermined number of character string lines isnot normal as a result of the judgment at Step S17, the segmentpreparing section 53 of the character string segmenting section 5 bmakes a change to increase/decrease the number of segments in the imageprocessing area B1 at Step S22 (a segment re-creating step).

Then, the main controller 50 of the character string segmenting section5 b makes a judgment at Step S23 (a step for judging the number ofsegmenting change operations) about whether or not the number ofoperations for increasing/decreasing the number of segments in the imageprocessing area B1 exceeds a predetermined number (for example, 5times).

As a result, if the number of operations for increasing/decreasing thenumber of segments in the image processing area B1 does not exceed thepredetermined number, operation returns to Step S13. Then, the segmentpreparing section 53 of the character string segmenting section 5 bmakes up a plurality of segments SE (for example, 16 segments) bysegmenting the image processing area B1 with the number of segments,increased/decreased at Step S22, in a direction of character stringsplaced on the medium 6.

On the other hand, if the number of operations for increasing/decreasingthe number of segments in the image processing area B1 exceeds thepredetermined number, it is concluded that, according to the number ofcharacter string lines for each prepared segment SE, judging thefrequency distribution on the number of segments showing thepredetermined number of character string lines to be normal is hardlypossible, despite further increasing/decreasing the number of segmentsin the image processing area B1. Then, operation progresses to Step S20,and the character string search area setting section 51 of the characterstring segmenting section 5 b sets a character string search area A2,which is different from the character string search area A1, over thebinary image data saved in the image memory 3. Afterwards, the sameoperation as the embodiment shown in FIG. 4 is carried out.

According to the steps described above, operation of segmenting theimage processing area B1 is repeated for the predetermined number oftimes so that the format recognition can be executed precisely.

For other processing, the same operation as the first embodimentdescribed above is carried out, and therefore the second embodimentproduces the same effects as the first embodiment does.

Other Embodiments of the Present Invention

In the first and second embodiments described above, the characterstring search area A1 placed according to the format of the ID card 6 isfurther narrowed so as to set the image processing area (effective area)B1 where the character string segmenting step and its following stepsbecome effective. Alternatively, not having the image processing area B1intentionally, the character string search area A1 may be used as animage processing area (effective area) for the character stringsegmenting step and its following steps. In other words, the steps S11and S12 may be combined as one step.

In the first and second embodiments described above; for checking if themedium is an ID card 6 or not, it is judged by making use of thesecond-order differences of character string center positions withrespect to each of the segments SE, whether or not the characterstring(s) placed on the medium is the predetermined character string(s).However, it is not necessarily needed to adopt a character string centerposition as a character string position showing a position of thecharacter string in the direction perpendicular to the direction of thecharacter string. Alternatively, for example, one of the trisectedpositions defined with (LT+2LB)/3 may be used as a character stringposition. Furthermore, instead of the method using second-orderdifferences, the multivariate analysis, such as the regression analysis,the principle component analysis, and so on may be applied as well.

In the first and second embodiments described above; used is the datainput section 2 composed of a combination of the medium transfermechanism 2 a and the one-dimensional imaging element 2 b.Alternatively, for example, the data input section 2 may be composed ofa combination of an area sensor, such as 2-dimensional CCD, a CMOSimager, etc., and a photographic subject support mechanism.

The character string recognition apparatus 1 in the first and secondembodiments described above includes the medium transfer mechanism 2 a.Alternatively, a character string recognition apparatus of a manualoperation type may be used, the character string recognition apparatustransferring the medium along a guiding surface such as the transferguide 2 c manually, without the medium transfer mechanism 2 a.

The character string recognition apparatus 1 for the ID card 6 isexplained in the first and second embodiments described above. Needlessto describe, alternatively the present invention may be applied to acharacter string recognition apparatus for recognizing a characterstring recorded in any medium other than the ID card 6 (for example, apassport, a check, a credit card, a debit card, digital cash, a driverlicense, a health insurance ID card, a pension book, a company ID card,a membership card, a library checkout card, and the like).

INDUSTRIAL APPLICABILITY

The character string recognition apparatus and the character stringrecognition method according to the present invention are suitablyapplied to recognition of a character string recorded in various kindsof media, such as an ID card, a passport, a check and the like.

While this invention has been described in conjunction with the specificembodiments outlined above, it is evident that many alternatives,modifications, and variations will be apparent to those skilled in theart. Accordingly, the preferred embodiments of the invention as setforth above are intended to be illustrative, not limiting. Variouschanges may be made without departing from the spirit and scope of theinventions as defined in the following claims.

REFERENCE NUMERALS

-   -   1 Character string recognition apparatus    -   2 Data input section    -   2 a Medium transfer mechanism    -   2 b One-dimensional imaging element    -   3 Image memory    -   5 Data processor    -   5 a Image binarizing section    -   5 b Character string segmenting section    -   5 c Character string search area storage section    -   5 d Character segmenting section    -   5 e Characteristics extracting section    -   5 f Characteristics comparing section    -   5 g Characteristics dictionary storage section    -   5 h Character judging section    -   6 ID card as a medium    -   50 Main controller    -   51 Character string search area setting section (Means for        setting character string search areas)    -   52 Image processing area setting section (Means for setting        image processing areas)    -   53 Segment preparing section (Means for preparing segments)    -   54 Projection calculating section (Means for calculating        projection)    -   55 Section for calculating the number of character string lines        (Means for calculating the number of character string lines)    -   56 Section for determining the number of character string lines        (Means for determining the number of character string lines)    -   57 Section for judging the number of character string lines    -   58 Difference calculating section    -   59 Character string validity check section (Means for checking        character string validity)    -   “A” Character string search area    -   “B” Image processing area    -   “SE” Segment

1. A character string recognition apparatus, for recognizing a characterstring through processing image data obtained by imaging the characterstring placed on a medium, comprising: means for setting a firstcharacter string search area on the medium; means for preparing segmentsfor making up a first plurality of segments by segmenting the characterstring search area in a direction of the character string; means forcalculating projection for calculating a projection of the image data indirection of the character string for each of the first segments; meansfor calculating a number of character string lines for each of the firstsegments according to the projection of the image data; means fordetermining the number of character string lines in the character stringsearch area as a whole according to the number of character string linesin each of the first segments; and means for checking the characterstring validity for verifying whether or not the character string is apredetermined character string, according to the number of characterstring lines in the character string search area as a whole.
 2. Thecharacter string recognition apparatus according to claim 1; wherein themeans for determining the number of character string lines creates afrequency distribution on the number of first segments showing apredetermined number of character string lines according to data of thenumber of character string lines in each of the first segments, anddetermines the number of character string lines in the character stringsearch area as a whole, with the number of character string lines havinga maximum frequency.
 3. The character string recognition apparatusaccording to claim 2; wherein the means for setting a character stringsearch area sets a second character string search area, being differentfrom the first character string search area, over the medium if thefrequency distribution on the number of first segments showing thepredetermined number of character string lines is not normal.
 4. Thecharacter string recognition apparatus according to claim 2; wherein themeans for preparing segments increases or decreases the number ofsegments for the character string search area to make up a second typeof segments, being different from the first segments, if the frequencydistribution on the number of first segments showing the predeterminednumber of character string lines is not normal.
 5. The character stringrecognition apparatus according to claim 1; wherein the means forchecking the character string validity calculates character stringpositions in a direction perpendicular to the direction of the characterstring for each of the first segments, and checks the presence ofunusual data in the character strings according to first-orderdifferences of positions of the character string, and then judges thatthe character strings are predetermined character strings if no unusualdata is detected in the character strings.
 6. The character stringrecognition apparatus according to claim 5; wherein the means forsetting a character string search area sets a second character stringsearch area, being different from the first character string searcharea, over the medium if unusual data is detected in the characterstrings.
 7. The character string recognition apparatus according toclaim 5; wherein, at the time of checking the presence of unusual datain the character strings, the means for checking the character stringvalidity judges that unusual data exists in the character strings if amaximum absolute value of second-order differences of character stringpositions with respect to each of the first segments exceeds apredetermined threshold.
 8. The character string recognition apparatusaccording to claim 5; wherein the character string positions arecharacter string center positions.
 9. The character string recognitionapparatus according to claim 1; wherein the number of first segments tobe made up is n-th power of 2, where “n” is a positive integer.
 10. Acharacter string recognition method, for recognizing a character stringthrough processing image data obtained by imaging the character stringplaced on a medium, comprising: a character string search area settingstep for setting the character string search area on the medium; asegment preparing step for making up a plurality of segments bysegmenting the character string search area in a direction of thecharacter string; a projection calculating step for calculating theprojection of the image data in direction of the character string foreach of the segments; a character string line calculating step forcalculating the number of character string lines for each of thesegments according to the projection of the image data; a step number ofcharacter string lines determining step for determining the number ofcharacter string lines in the character string search area as a wholeaccording to the number of character string lines in each of thesegments; and a step character string validity checking step forverifying whether or not the character string is a predeterminedcharacter string, according to the number of character string lines inthe character string search area as a whole.